package com.education.welco.controller.app;


import com.education.common.core.BaseController;
import com.education.welco.pojo.TSchool;
import com.education.welco.service.ITSchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 学校 信息操作处理
 *
 * @author d
 * @date 2020-05-08
 */
@RestController
@RequestMapping("/app/tSchool")
public class AppTSchoolController extends BaseController {


    @Autowired
    private ITSchoolService itSchoolService;

    /**
     * feign远程调用
     * @param schoolId
     * @return
     */
    @GetMapping("/findBySchoolId")
    public String findBySchoolId(Integer schoolId) {
        TSchool school = itSchoolService.selectTSchoolById(schoolId);
        if (school == null){
            return null;
        }
        return school.getSchoolName();
    }
}